package com.example.config;

import com.tencentcloudapi.aiart.v20221229.AiartClient;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DrawConfiguration {

    @Value("${ai.ak}")
    private String ak;

    @Value("${ai.sk}")
    private String sk;

    @Bean
    public AiartClient aiartClient(){
        Credential credential = new Credential(ak,sk);
        HttpProfile httpProfile = new HttpProfile();
        httpProfile.setEndpoint("aiart.tencentcloudapi.com");
        ClientProfile clientProfile = new ClientProfile();
        clientProfile.setHttpProfile(httpProfile);
        return new AiartClient(credential,"ap-shanghai",clientProfile);
    }


}
